#ifndef __OLED_SPI__
#define __OLED_SPI__

#include "ti_msp_dl_config.h"

#define OLED_CMD    0  // 写命令
#define OLED_DATA   1  // 写数据
#define OLED_MODE   0

#define u8          unsigned char
#define u32         unsigned int


//-----------------OLED端口定义----------------

#define OLED_DC_Clr() DL_GPIO_clearPins(GPIO_OLED_PORT, GPIO_OLED_DC_PIN)
#define OLED_DC_Set() DL_GPIO_setPins(GPIO_OLED_PORT, GPIO_OLED_DC_PIN)

// OLED模式设置
// 0:4线串行模式
// 1:并行8080模式

#define SIZE         16 // 单个字符长度为8
#define XLevelL      0x02
#define XLevelH      0x10
#define Max_Column   128
#define Max_Row      64
#define Brightness   0xFF
#define X_WIDTH      128
#define Y_WIDTH      64

// OLED控制用函数
void OLED_Init(void);
void OLED_Clear(void);
void OLED_ShowChar(u8 x, u8 y, char chr);
void OLED_ShowNum(u8 x, u8 y, u32 num, u8 len);
void OLED_ShowString(u8 x, u8 y, char *p);
void OLED_ShowChinese(u8 x, u8 y, u8 no);
void OLED_DrawBMP(unsigned char x0, unsigned char y0, unsigned char x1, unsigned char y1, const unsigned char BMP[]);

#endif
